package com.hliushi.learn.annotation.valid;

import javax.validation.Constraint;
import javax.validation.Payload;
import javax.validation.constraints.Pattern;
import java.lang.annotation.*;

@Documented
@Pattern(
        regexp = "^[1][1-9][0-9]{9}$",
        message = "Invalid phone number format"
)
@Constraint(
        validatedBy = {}
)
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Phone {
    String message() default "";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
